<template>
  <i :class="_defineClass " v-if="_iconType=='define'" :type="inputType"></i>
  <a-icon :type="inputType" v-else-if="_iconType=='system'"/>
</template>

<script>
  export default {
    name: 'KIcon',
    props: {
      type: {
        type: String,
        required:true
      }
    },
    data() {
      return {
        inputType: '',
        iconType: "system"
      }
    },
    computed: {
      _iconType() {
        if (this.type.indexOf("iconfont")>-1) {
          return "define"
        } else {
          return "system"
        }
      },
      _defineClass(){
         if(this._iconType=="define"){
           return "iconfont "+this.type;
         }
      }
    },
    watch: {
    },
    created() {
      this.inputType = this.type
    },
    methods: {}
  }
</script>